package com.hust.bridgecheck.controller.UserManagement;


import com.hust.bridgecheck.entity.Domain;
import com.hust.bridgecheck.service.UserManagement.DomainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("domian")
public class DomainController {
    @Autowired
    private DomainService domainService;
    @PostMapping("/add")
    private Domain addDomain(Domain domain){
        return domainService.addDomain(domain);
    }
    @DeleteMapping("/delete")
    private void deleteDomain(Integer DomainID){
        domainService.deleteDomain(DomainID);
    }
    @GetMapping("/all")
    private List<Domain> getAllDomain(){
        return domainService.getAllDomain();
    }
    @GetMapping("/getbyid")
    private Domain getDomainByID(Integer DomainID){
        return domainService.getDomainByID(DomainID);
    }
    @PutMapping("/update")
    private Domain updateDomain(Domain domain){
        return domainService.updateDomain(domain);
    }
}
